import request from "./request";
/**
 * 获取文章或者沸点
 * @param data
 * @constructor
 */
export function GetArticleList(data:any){
        return  request({
            method:"POST",
            url:"api/articleList",
            data
        })
}
export  function  GetUserInfo(data:any){
    return  request({
        method:"POST",
        url:"/api/login",
        data
    })
}

/**
 * 新增帖子
 * @param data
 * @constructor
 */
export  function AddModifyArticle(data:any){
        return request({
            method:"POST",
            url:"api/addModifyArticle",
            data
        })
}
function getToken(){
    return sessionStorage.getItem("token")
}
/**
 * 回复帖子
 * @param data
 * @constructor
 */
export  function AddFirstComment(data:any){
    return request({
        method:"POST",
        url:"api/addComment",
        data
    })
}

/**
 * 二级帖子
 * @param data
 * @constructor
 */
export  function AddSecondComment(data:any){
    return request({
        method:"POST",
        url:"api/addComment",
        data
    })
}

/**
 * 获取评论列表
 * @param data
 * @constructor
 */
export function GetArticleInfo(data:any){
    return request(
        {
            method:"POST",
            url:"api/articleInfo",
            data
        }
    )
}
